//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet.UI
{
    class PrefxedDoubleAutoFillFunction
    {
        public PrefxedDoubleAutoFillFunction(string prefix, double firstValue, double lastValue, int length)
        {
            Prefix = prefix;
            this.BaseValue = lastValue;
            if (length > 1)
                increment = (lastValue - firstValue) / (length - 1);
            else
                increment = 1;
        }
        string Prefix;
        double BaseValue;
        double increment;
        public  object GetValue(int index)
        {
            return Prefix + (BaseValue + index * increment);
        }
    }
}
